package com.kehutong.wxapi.request;

import org.coraframework.json.annotation.JSONField;

/**
 * 编辑入群欢迎语素材请求对象
 * @author: liukunlong
 * @date: 2021-03-05 10:36
 */
public class GroupWelcomeTemplateEditRequest {
    /**
     * 调用接口凭证
     */
    private String accessToken;
    /**
     * templateId
     */ /**
     * template_id : msgXXXXXXX
     * text : {"content":"文本消息内容"}
     * image : {"media_id":"MEDIA_ID","pic_url":"http://p.qpic.cn/pic_wework/3474110808/7a6344sdadfwehe42060/0"}
     * link : {"title":"消息标题","picurl":"https://example.pic.com/path","desc":"消息描述","url":"https://example.link.com/path"}
     * miniprogram : {"title":"消息标题","pic_media_id":"MEDIA_ID","appid":"wx8bd80126147df384","page":"/path/index"}
     * agentid : 1000014
     */
    @JSONField(name = "template_id")
    private String templateId;
    /**
     * 消息文本对象
     */
    @JSONField(name = "text")
    private TextDTO text;
    /**
     * 图片对象
     */
    @JSONField(name = "image")
    private ImageDTO image;
    /**
     * 图文对象
     */
    @JSONField(name = "link")
    private LinkDTO link;
    /**
     * 小程序对象
     */
    @JSONField(name = "miniprogram")
    private MiniprogramDTO miniprogram;
    /**
     * 授权方安装的应用agentid。仅旧的第三方多应用套件需要填此参数
     */
    @JSONField(name = "agentid")
    private Integer agentid;


    public String getAccessToken() {
        return accessToken;
    }

    public void setAccessToken(String accessToken) {
        this.accessToken = accessToken;
    }

    public String getTemplateId() {
        return templateId;
    }

    public void setTemplateId(String templateId) {
        this.templateId = templateId;
    }

    public TextDTO getText() {
        return text;
    }

    public void setText(TextDTO text) {
        this.text = text;
    }

    public ImageDTO getImage() {
        return image;
    }

    public void setImage(ImageDTO image) {
        this.image = image;
    }

    public LinkDTO getLink() {
        return link;
    }

    public void setLink(LinkDTO link) {
        this.link = link;
    }

    public MiniprogramDTO getMiniprogram() {
        return miniprogram;
    }

    public void setMiniprogram(MiniprogramDTO miniprogram) {
        this.miniprogram = miniprogram;
    }

    public Integer getAgentid() {
        return agentid;
    }

    public void setAgentid(Integer agentid) {
        this.agentid = agentid;
    }

    public static class TextDTO {
        /**
         * 消息文本内容,最长为4000字节
         */ /**
         * content : 文本消息内容
         */
        @JSONField(name = "content")
        private String content;

        public String getContent() {
            return content;
        }

        public void setContent(String content) {
            this.content = content;
        }
    }

    public static class ImageDTO {
        /**
         * 图片的media_id，可以通过素材管理接口获得
         */ /**
         * media_id : MEDIA_ID
         * pic_url : http://p.qpic.cn/pic_wework/3474110808/7a6344sdadfwehe42060/0
         */
        @JSONField(name = "media_id")
        private String mediaId;
        /**
         * 图片的链接，仅可使用上传图片接口得到的链接
         */
        @JSONField(name = "pic_url")
        private String picUrl;

        public String getMediaId() {
            return mediaId;
        }

        public void setMediaId(String mediaId) {
            this.mediaId = mediaId;
        }

        public String getPicUrl() {
            return picUrl;
        }

        public void setPicUrl(String picUrl) {
            this.picUrl = picUrl;
        }
    }

    public static class LinkDTO {
        /**
         * 图文消息标题，最长为128字节
         */ /**
         * title : 消息标题
         * picurl : https://example.pic.com/path
         * desc : 消息描述
         * url : https://example.link.com/path
         */
        @JSONField(name = "title")
        private String title;
        /**
         * 图文消息封面的url
         */
        @JSONField(name = "picurl")
        private String picurl;
        /**
         * 图文消息的描述，最长为512字节
         */
        @JSONField(name = "desc")
        private String desc;
        /**
         * 图文消息的链接
         */
        @JSONField(name = "url")
        private String url;

        public String getTitle() {
            return title;
        }

        public void setTitle(String title) {
            this.title = title;
        }

        public String getPicurl() {
            return picurl;
        }

        public void setPicurl(String picurl) {
            this.picurl = picurl;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public String getUrl() {
            return url;
        }

        public void setUrl(String url) {
            this.url = url;
        }
    }

    public static class MiniprogramDTO {
        /**
         * 小程序消息标题，最长为64字节
         */ /**
         * title : 消息标题
         * pic_media_id : MEDIA_ID
         * appid : wx8bd80126147df384
         * page : /path/index
         */
        @JSONField(name = "title")
        private String title;
        /**
         * 小程序消息封面的mediaid，封面图建议尺寸为520*416
         */
        @JSONField(name = "pic_media_id")
        private String picMediaId;
        /**
         * 小程序appid，必须是关联到企业的小程序应用
         */
        @JSONField(name = "appid")
        private String appid;
        /**
         * 小程序page路径
         */
        @JSONField(name = "page")
        private String page;

        public String getTitle() {
            return title;
        }

        public void setTitle(String title) {
            this.title = title;
        }

        public String getPicMediaId() {
            return picMediaId;
        }

        public void setPicMediaId(String picMediaId) {
            this.picMediaId = picMediaId;
        }

        public String getAppid() {
            return appid;
        }

        public void setAppid(String appid) {
            this.appid = appid;
        }

        public String getPage() {
            return page;
        }

        public void setPage(String page) {
            this.page = page;
        }
    }
}
